﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Model;
using IDAL;
using BLL;
using DAL;
/***************************
 * 数据访问层
 * 审核的数据
 * Author：JXL
 ***************************/
namespace EstateService.Controllers
{
    public class AuditController : ApiController
    {
        Factory<IAuditDAL, AuditDAL> bll = new Factory<IAuditDAL, AuditDAL>();

        // GET api/audit
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="pronum"></param>
        /// <returns></returns>
        [HttpGet]
        [ActionName("getlist")]
        public pagelist<Basic_infoss> getlist(int pageindex, int pagesize, string wherestr)
        {
            return bll.bll().getlist(pageindex, pagesize, wherestr);
        }

        // GET api/audit/5
        public string Get(int id)
        {
            return "value";
        }





        // POST api/audit
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="bas"></param>
        /// <returns></returns>
        public int Post(int id,[FromBody]Basic_infoss bas)
        {
            bas.auditing_Time = DateTime.Now;
            return bll.Fbi().Audit(bas,id);
        }




        // PUT api/audit/5
        [HttpGet]
        [ActionName("putup")]
        public int putup(int id,int state)
        {
            
            return bll.Fbi().NoAudit(id,state);
        }

        // DELETE api/audit/5
        public void Delete(int id)
        {
        }
    }
}
